package com.open.capacity.common.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
/**
 * @Author moonholder
 * @Description 积分日志
 * @Date 15:35 2021/2/4
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class PointsLog implements Serializable {
    /**
     * 积分日志id
     */
    @TableId(value = "plogid",type = IdType.AUTO)
    private Integer plogid;

    /**
     * 用户id
     */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long userid;

    /**
     * 积分规则id
    */
    private Integer poruid;

    /**
     * 分数
     */
    private Integer points;

    /**
     * 逻辑删除 1 正常 2 删除
     */
    @TableLogic(value = "1",delval = "2")
    private Boolean status;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date cretim;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updtim;

    private static final long serialVersionUID = 1L;
}

